<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>缤格</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/binge.css"/>
    <script type="text/javascript" src="../../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../../script/swiper.min.js"></script>
    <script type="text/javascript" src="../../script/mobile.js"></script>
    <script type="text/javascript">
        window['adaptive'].desinWidth = 750;
        window['adaptive'].baseFont = 28;
        window['adaptive'].maxWidth = 750;
        window['adaptive'].init();
    </script>
</head>
<body>
<!-- person info -->
<div class="person-index bg-cover" id="memberBg" style="background: url(../../icon/bg-person-default.png)">
    <div class="member-share" style="height: 100%;"></div>
    <div id="header" style="position: relative;z-index: 9;">
        <!-- header -->
        <div class="header">
            <div class="head-back">
                <a href="javascript:void(0);" tapmode onclick="comeBack()" class="back-btn-white"></a>
            </div>
            <!--<div class="head-title">-->
            <!--<h6>搜索结果</h6>-->
            <!--</div>-->
            <div class="head-action">
                <a href="javascript:void(0);" tapmode onclick="openModel()" class="action-btn-white"></a>
            </div>
        </div>
        <!-- header end -->
    </div>

    <div class="person-view" style="position: relative;z-index: 9;">
        <div class="userRelative" style="width: 1.3rem;height: 1.3rem;">
            <div class="person-img bg-cover" id="nameImg" style="background: url()"></div>
            <span class="attestation" style="display: none;"></span>
        </div>
        <div class="person-detail">
            <h6 id="name"></h6>
            <div class="person-sex">
                <span class="icon icon1"></span>
                <span class="icon icon2" style="display: none;"></span>
            </div>
            <a href="javascript:void(0);" tapmode onclick="followStatus(this)" class="follow" id="follow">关注</a>
        </div>
        <div class="person-date">
            <span class="date" id="day">296天</span>
            <span class="fraction" id="integral">98分</span>
        </div>
        <div class="person-fraction">
            <ul id="evaluate">
                <li class="star"></li>
                <li class="star"></li>
                <li class="star"></li>
                <li class="star"></li>
                <li class="star"></li>
            </ul>
            <dl class="badge-list" id="badge" tapmode onclick="toBadgePage(event)">
                <!--<dd class="icon"><img src="../../icon/icon-hz01.png" alt=""></dd>-->
            </dl>
        </div>
        <div class="person-autograph">
            <p class="multiline-ellipsis" id="autograph">这个人比较懒，没有个性签名</p>
        </div>
        <div class="person-kinds">
            <ul>
                <li tapmode onclick="goHZ();">
                    <p class="num" id="fabulous_num">0</p>
                    <p class="label">获赞</p>
                </li>
                <li tapmode onclick="goFs();">
                    <p class="num" id="fans_num">0</p>
                    <p class="label">粉丝</p>
                </li>
                <li tapmode onclick="goGz();">
                    <p class="num" id="follow_num">0</p>
                    <p class="label">关注</p>
                </li>
            </ul>
        </div>
    </div>


</div>

<!-- person info end -->


<!-- index-main -->
<div class="person-dynamic-kinds">
    <ul>
        <li tapmode onclick="tabComment(1,this)" class="on"><span>动态</span></li>
        <li tapmode onclick="tabComment(5,this)"><span>投票</span></li>
        <li tapmode onclick="tabComment(2,this)"><span>需求</span></li>
        <li tapmode onclick="tabComment(3,this)"><span>评论</span></li>
        <li tapmode onclick="tabComment(4,this)"><span>新闻</span></li>
    </ul>
</div>
<div class="person-main">
    <div class="dynamic-section" style="display: block">
        <div class="index-news user-dynamic">
            <ul id="inviteContent">

            </ul>
        </div>
    </div>

    <div class="dynamic-section" style="display: none">
        <div class="index-news user-dynamic">
            <ul id="voteContent">

            </ul>
        </div>
    </div>
    <div class="dynamic-section" style="display: none;">
        <div class="activity-list">
            <ul id="actContent">

            </ul>
        </div>
    </div>

    <div class="dynamic-section" style="display: none;">
        <div class="person-comment">
            <ul id="plHtml">
                <!--<li class="list-li" onclick="commonUrl()" tapmode>
                    <div class="common-user-detail">
                        <div class="user-info">
                            <div class="user-icon bg-cover"
                                 style="background-image: url('../../image/img-tx.png');"></div>
                            <div class="info">
                                <div class="name">
                                    <h6>后来熟悉</h6>
                                    <dl class="badge-list">
                                        <dd class="icon"><img src="../../icon/icon-hz01.png" alt=""></dd>
                                        <dd class="icon"><img src="../../icon/icon-hz02.png" alt=""></dd>
                                        <dd class="icon"><img src="../../icon/icon-hz03.png" alt=""></dd>
                                        <dd class="icon"><img src="../../icon/icon-hz04.png" alt=""></dd>
                                        <dd class="icon"><img src="../../icon/icon-hz05.png" alt=""></dd>
                                    </dl>
                                </div>
                                <span class="time">1小时前</span>
                            </div>
                        </div>
                        <div class="follow" tapmode onclick="follow()">
                            <span class="no-follow">关注</span>
                            <span class="followed">已关注</span>
                        </div>
                    </div>
                    <div class="comment-detail multiline-ellipsis_3">
                        <p>厉害了，我的哥！厉害了，我的哥！厉害了，我的哥！厉害了，我的哥！厉害了，我的哥！</p>
                    </div>
                    <div class="invitation-div" tapmode onclick="commonUrl()">
                        <div class="invite-icon bg-cover" style="background: url('../../image/img01.png')"></div>
                        <div class="invite-info">
                            <h6 class="single-ellipsis"><span>帖子</span>跟着音乐一起嗨！</h6>
                            <p>来自音乐圈</p>
                        </div>
                    </div>
                </li>-->
            </ul>
        </div>
    </div>

    <div class="dynamic-section" style="display: none">
        <div class="index-news">
            <ul id="newsContent">

            </ul>
        </div>
    </div>


</div>

<!-- index-main end -->
<!--<section class="mask_pop">
    <div class="mask"></div>
    <div class="msg_pop2 pop pb20" style="display: none;">
        <div class="msg_pop_title">通知</div>
        <div class="msg_pop_content" style="text-align: center;">您确定要该账号吗？ <br>注销后无法再次登录</div>
        <div class="flex_center pb20">
            <div class="btn7 mr30" onclick="cancelUserName();">确定注销</div>
            <div class="btn6" onclick="popClose();">取消</div>
        </div>
    </div>
</section>-->

<!-- 右上角操作 -->
<div class="action-model model" tapmode onclick="closeModel()">
    <div class="action-view" tapmode onclick="stopModel(event)">
        <h6 class="shareTitle">分享</h6>
        <a href="javascript:void(0);" tapmode onclick="closeModel(event)" class="model-close"></a>
        <div class="model-detail">
            <ul>
                <li tapmode onclick="shareWx(event)" class="threeShare">
                    <div class="share-icon icon1"></div>
                    <p>微信</p>
                </li>
                <li tapmode onclick="shareWxq(event)" class="threeShare">
                    <div class="share-icon icon2"></div>
                    <p>朋友圈</p>
                </li>
                <li tapmode onclick="shareQq(event)" class="threeShare">
                    <div class="share-icon icon3"></div>
                    <p>QQ</p>
                </li>
                <li tapmode onclick="shareQzone(event)" class="threeShare">
                    <div class="share-icon icon4"></div>
                    <p>QQ空间</p>
                </li>
                <li tapmode onclick="shareWb(event)" class="threeShare">
                    <div class="share-icon icon5"></div>
                    <p>微博</p>
                </li>
                <li tapmode class="copy" onclick="copyLink()">
                    <div class="share-icon icon-copy"></div>
                    <p>复制链接</p>
                </li>
                <li tapmode onclick="reportBtn(event)">
                    <div class="share-icon icon-report"></div>
                    <p>举报</p>
                </li>
            </ul>
        </div>
        <div class="shade-user">
            <a href="javascript:void(0);" tapmode onclick="shieldPerson(this)" class="shade-btn"><span id="shield">屏蔽此人</span></a>
        </div>
    </div>
</div>
<!-- 右上角操作 end -->

<div class="fixed-btn">
    <a href="javascript:void(0);" tapmode onclick="reloadPage()" class="reload-view"></a>
</div>

</body>

</html>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/clipboard.min.js"></script>
<script type="text/javascript">
    var _model = $(".model");
    var member_id = '';//用户id
    var type = 1;//1动态，2活动，3评论
    var page = 1;//页码
    var pullUp = true;
    var shareTitle = '';//分享title
    var shareInfo = '发现精彩大学生活，更多内容，尽在大学情报局～（分享自大学情报局 App）';
    var shareImg = 'widget://icon/logo.png';//分享图片
    var WebshareImg = 'widget://icon/logo.png';//分享图片
    apiready = function () {
        $api.fixStatusBar($api.dom('#header'));
        api.setStatusBarStyle({
            style: 'light',
            color: 'transparent'
        });
        keybackListener()
        //setFixStatusBar(); //设置状态栏
        member_id = api.pageParam.member_id;
        // member_id = 5;

        //上拉加载
        pullUpLoading(function () {
            if (pullUp == true) {
                pullUp = false;
                getOtherDetail()
            }
        })
        /*//下拉刷新
        dropDownRefresh(function () {
            page = 1;
            getOtherDetail()
        })*/

        getOtherDetail()


        SystemCheckVersion()
    };

    function openApp() {
        $(".mask").show();
        $(".mask_pop").addClass("on");
        $(".msg_pop2").show();
    }

    function popClose() {
        $(".mask").hide();
        $(".mask_pop").removeClass("on");
    }

    //屏蔽此人
    function shieldPerson(that) {
        var _this = $(that);
        if(_this.hasClass('on')){
            cancelShield(member_id,4,'',event,1,function () {
                _this.removeClass('on').find('#shield').html('屏蔽此人');
                closeModel()
                api.sendEvent({
                    name: 'shield',
                });
            })

        }else {
            shield(member_id,event,4,'',function () {
                _this.addClass('on').find('#shield').html('取消屏蔽');
                closeModel()
                api.sendEvent({
                    name: 'shield',
                });
            })
        }


    }

    //刷新页面
    function reloadPage() {
        page = 1;
        getOtherDetail()
    }

    //举报
    function reportBtn(event) {
        event.stopPropagation()
        var param = {
            type: 5,
            pid: member_id,
        }
        commonUrl('../member/jubao',param);
        closeModel()
    }

    function goHZ(){
        commonUrl('../member/myGetLike',{member_id:member_id});
    }

    function goFs(){
        commonUrl('../member/myFans',{member_id:member_id});
    }

    function goGz(){
        commonUrl('../member/myLike',{member_id:member_id});
    }



    //获取其他人个人主页
    function getOtherDetail() {
        var param = {
            token: $api.getStorage('token'),
            member_id: member_id,
            type: type,//1动态，2活动，3评论
            page: page
        }
        pop.loading();
        getAjax(Interface.member_home, param, function (res) {
            //console.log(jsonChange(res))
            var member = res.data.member;
            var list = res.data.list;

            if (isDefine(member)) {

                shareTitle = member.name + '的主页';
                if(isDefine(member.icon_path)){
                    shareImg = ajaxUrl  + member.icon_path;
                }

                if(isDefine(member.shield_status)){
                    if(member.shield_status==1){
                        $(".shade-btn").addClass('on').find("#shield").html('取消屏蔽');
                    }else {
                        $(".shade-btn").removeClass('on').find("#shield").html('屏蔽此人');
                    }
                }

                if(isDefine(member.attestation_status)){
                    if(member.attestation_status==1 || member.attestation_status==3){
                        $(".attestation").hide();
                    }else {
                        $(".attestation").show();
                    }
                }


                $("#name").html(member.name);
                $("#nameImg").css({background: 'url(' + ajaxUrl + member.icon_path + ')'});
                $("#memberBg").css({background: 'url(' + ajaxUrl + member.background_path + ')'});
                $("#day").html(member.days + '天');
                $("#integral").html(member.integral + 'ml');
                if (isDefine(member.autograph) && member.autograph!=0) {
                    $("#autograph").html(member.autograph)
                }else {
                    $("#autograph").html(commonNote)
                }
                $("#fabulous_num").html(member.fabulous_number)
                $("#fans_num").html(member.fans)
                $("#follow_num").html(member.follow)

                //性别
                if (isDefine(member.sex)) {
                    if (member.sex == 1) {
                        $(".person-sex").show().find('.icon1').hide().siblings('.icon2').show();
                    } else if (member.sex == 2) {
                        $(".person-sex").show().find('.icon2').hide().siblings('.icon1').show();
                    } else {
                        $(".person-sex").hide();
                    }
                }

                //徽章
                if (isDefine(member.badge_path)) {
                    var badge = '';
                    for (var i = 0; i < member.badge_path.length; i++) {
                        badge += '<dd class="icon"><img src="' + ajaxUrl + member.badge_path[i] + '" alt=""></dd>'
                    }
                    $("#badge").html(badge)
                }
                //星级
                if (isDefine(member.evaluate)) {

                    if (member.evaluate != 0) {

                        var starList = '';
                        for (var i = 0; i < member.evaluate; i++) {
                            starList += '<li class="star on"></li>'
                        }
                        var nostar = 5 - parseInt(member.evaluate);
                        for (var i = 0; i < nostar; i++) {
                            starList += '<li class="star"></li>'
                        }
                        $("#evaluate").html(starList)
                    }
                }

                //是否关注

                if (member.follow_status == 1) {
                    $("#follow").addClass('on').html('已关注');
                } else {
                    $("#follow").removeClass('on').html('关注');
                }

            }

            if (isDefine(list)) {

                if (type == 1) {

                    var listHtml = '';

                    for (var i = 0; i < list.length; i++) {

                        var dynamic = list[i]
                        listHtml += getInviteText(dynamic,1);

                    }

                    if (page == 1) {
                        $("#inviteContent").html(listHtml)
                    } else {
                        $("#inviteContent").append(listHtml)
                    }

                } else if (type == 2) {

                    var listHtml = '';

                    for (var i = 0; i < list.length; i++) {

                        var activity = list[i]

                        listHtml += getActivityText(activity,1);
                    }

                    if (page == 1) {
                        $("#actContent").html(listHtml)
                    } else {
                        $("#actContent").append(listHtml)
                    }
                    SystemCheckVersion()

                } else if (type == 3) {

                    var plHtml = '';
                    for (var i = 0; i < list.length; i++) {

                        var listData = list[i];

                        var userData = listData.member;

                        var follow = '';//是否关注
                        var badgeList = '';//徽章列表
                        var toUp = '';//顶置
                        var hotHtml = '';//标签，热度
                        var userInfo = '';
                        var infoMain = '';

                        //顶置，标签，热度
                        if (listData.top == 1) {
                            toUp = '<span class="bt-pd toUp">置顶</span>';
                        }
                        var tips = '';//标签
                        if (isDefine(listData.cut_list)) {
                            for (var z = 0; z < listData.cut_list.length; z++) {
                                tips += '<span class="bt-pd tips">#' + listData.cut_list[z] + '#</span>'
                            }
                        }
                        hotHtml = '<div class="detail-bottom">' +
                            '              <div class="bottom-tips">' + toUp + tips + '</div>' +
                            '              <div class="bottom-hot">' + listData.hot_number + '</div>' +
                            '          </div>';


                        if (member.follow_status == '0') {
                            follow = '<div class="follow">' +
                                '         <span class="no-follow"  tapmode onclick="followAction(1,' + userData.id + ',this)">关注</span>' +
                                '         <span class="followed"  tapmode onclick="followAction(2,' + userData.id + ',this)">已关注</span>' +
                                '     </div>'
                        } else {
                            /*follow = '<div class="follow on">' +
                                '         <span class="no-follow"  tapmode onclick="followAction(1,' + userData.id + ',this)">关注</span>' +
                                '         <span class="followed"  tapmode onclick="followAction(2,' + userData.id + ',this)">已关注</span>' +
                                '     </div>'*/
                        }
                        if (isDefine(userData.badge_path)) {
                            for (var k = 0; k < userData.badge_path.length; k++) {
                                if (k <= 5) {
                                    badgeList += '<dd class="icon"><img src="' + ajaxUrl + userData.badge_path[k] + '" alt=""></dd>'
                                }
                            }
                        }

                        var userVip = '';
                        if(isDefine(userData.attestation_status)){
                            if(userData.attestation_status == 2){
                                userVip = '<span class="vip"></span>';
                            }
                        }

                        userInfo = '<div class="common-user-detail">' +
                            '           <div class="user-info">' +
                            '               <div class="userRelative"><div class="user-icon bg-cover" style="background-image: url(' + ajaxUrl + userData.icon_path + ');"></div>'+userVip+'</div>' +
                            '               <div class="info">' +
                            '                    <div class="name">' +
                            '                        <h6>' + userData.name + '</h6>' +
                            '                        <dl class="badge-list" tapmode onclick="toBadgePage(event)">' + badgeList + '</dl>' +
                            '                    </div>' +
                            '                    <span class="time">' + listData.date + '</span>' +
                            '                </div>' +
                            '            </div>' + follow + '</div>';


                        if (listData.type == 1) {
                            //新闻
                            var news_id = {"news_id": listData.article_id}
                            infoMain = '<div class="comment-detail multiline-ellipsis_3" style="-webkit-line-clamp: initial;">' +
                                '                        <p>' + listData.comment + '</p>' +
                                '                    </div>' +
                                '                    <div class="invitation-div" tapmode onclick=\'commonUrl("../index/news_detail",' + jsonChange(news_id) + ')\'>' +
                                '                        <div class="invite-icon bg-cover" style="background: url(' + ajaxUrl + listData.content_path + ')"></div>' +
                                '                        <div class="invite-info">' +
                                '                            <h6 class="single-ellipsis"><span>新闻</span>' + listData.title + '</h6>' +
                                '                            <p>来自新闻</p>' +
                                '                        </div>' +
                                '                    </div>';

                        } else if (listData.type == 2) {
                            //帖子
                            var invitation_id = {'invitation_id': listData.article_id};
                            infoMain = '<div class="comment-detail multiline-ellipsis_3" style="-webkit-line-clamp: initial;">' +
                                '                        <p>' + listData.comment + '</p>' +
                                '                    </div>' +
                                '                    <div class="invitation-div" tapmode onclick=\'commonUrl("../circle/invite_detail",' + jsonChange(invitation_id) + ')\'>' +
                                '                        <div class="invite-icon bg-cover" style="background: url(' + ajaxUrl + listData.content_path + ')"></div>' +
                                '                        <div class="invite-info">' +
                                '                            <h6 class="single-ellipsis"><span>帖子</span>' + listData.title + '</h6>' +
                                '                            <p>来自' + listData.circle_title + '</p>' +
                                '                        </div>' +
                                '                    </div>';


                        } else if (listData.type == 3) {
                            //活动
                            var activity_id = {'activity_id': listData.article_id};
                            infoMain = '<div class="comment-detail multiline-ellipsis_3" style="-webkit-line-clamp: initial;">' +
                                '                        <p>' + listData.comment + '</p>' +
                                '                    </div>' +
                                '                    <div class="invitation-div" tapmode onclick=\'commonUrl("../activity/activity_index",' + jsonChange(activity_id) + ')\'>' +
                                '                        <div class="invite-icon bg-cover" style="background: url(' + ajaxUrl + listData.content_path + ')"></div>' +
                                '                        <div class="invite-info">' +
                                '                            <h6 class="single-ellipsis"><span>活动</span>' + listData.title + '</h6>' +
                                '                            <p>来自' + listData.circle_title + '</p>' +
                                '                        </div>' +
                                '                    </div>';

                        }

                        plHtml += '<li class="list-li">' + userInfo + infoMain + '</li>';


                    }

                    if (page == 1) {
                        $("#plHtml").html(plHtml)
                        console.log(plHtml)
                    } else {
                        $("#plHtml").append(plHtml)
                    }

                    SystemCheckVersion()
                } else if (type == 4) {

                    var newsHtml = '';

                    for (var i = 0; i < list.length; i++) {

                        var listHtml = list[i];
                        newsHtml += getNewsText(listHtml,'','',1);
                    }

                    if (page == 1) {
                        $("#newsContent").html(newsHtml)
                    } else {
                        $("#newsContent").append(newsHtml)
                    }
                    SystemCheckVersion()

                } else if (type == 5) {

                    var voteHtml = '';

                    voteHtml += getVoteText(list);

                    if (page == 1) {
                        $("#voteContent").html(voteHtml)
                    } else {
                        $("#voteContent").append(voteHtml)
                    }

                }

                page++;
                pullUp = true;
                SystemCheckVersion()

            } else {

                if (type == 1) {
                    if (page == 1) {
                        $("#inviteContent").html(noData)
                    } else {
                        $("#inviteContent").append('<p class="c-999 t-c pt30 pb20" style="width: 100%;">没有更多了</p>')
                    }
                } else if (type == 2) {
                    if (page == 1) {
                        $("#actContent").html(noData)
                    } else {
                        $("#actContent").append('<p class="c-999 t-c pt30 pb20" style="width: 100%;">没有更多了</p>')
                    }
                } else if (type == 3) {
                    if (page == 1) {
                        $("#plHtml").html(noData)
                    } else {
                        $("#plHtml").append('<p class="c-999 t-c pt30 pb20" style="width: 100%;">没有更多了</p>')
                    }
                } else if (type == 4) {
                    if (page == 1) {
                        $("#newsContent").html(noData)
                    } else {
                        $("#newsContent").append('<p class="c-999 t-c pt30 pb20" style="width: 100%;">没有更多了</p>')
                    }
                } else if (type == 5) {
                    if (page == 1) {
                        $("#voteContent").html(noData)
                    } else {
                        $("#voteContent").append('<p class="c-999 t-c pt30 pb20" style="width: 100%;">没有更多了</p>')
                    }
                }

                pullUp = false;
                SystemCheckVersion()
            }


            pop.close();
        }, function (error) {
            pop.notice(error.msg);
            pop.close();
        })
    }


    //切换
    function tabComment(tab, that) {
        $(that).addClass('on').siblings('li').removeClass('on');
        $('.person-main .dynamic-section').eq($(that).index()).show().siblings(".dynamic-section").hide();
        type = tab;
        page = 1;
        getOtherDetail()
    }


    //列表 --- 关注、取消关注
    function followAction(stype, pid, that) {
        var type = 1;//类型：1会员 2圈子
        follow(stype, type, pid, function (res) {
            if (stype == 1) {
                pop.notice('关注成功');
                $('.person-main').find('.follow').remove();//.addClass('on');
                $("#follow").addClass('on').html('已关注');

            } else {
                pop.notice('已取消关注');
                $('.person-main').find('.follow').removeClass('on');
                $("#follow").removeClass('on').html('关注');

            }
        })
    }

    //资料栏 --- 关注、取消关注
    function followStatus(that) {
        var type = 1;//类型：1会员 2圈子
        if ($(that).hasClass('on')) {
            stype = 2;
        } else {
            stype = 1;
        }
        console.log(stype)
        follow(stype, type, member_id, function (res) {
            if (stype == 1) {
                pop.notice('关注成功');
            } else {
                pop.notice('已取消关注');
            }
            setTimeout(function () {
                page = 1;
                getOtherDetail()
            }, 1000)
        })
    }




    //开启弹窗
    function openModel() {
        _model.addClass('showModel');
        setTimeout(function () {
            _model.find('.action-view').addClass('showView');
        }, 10)
    }

    //阻止事件冒泡
    function stopModel(event) {
        event.stopPropagation();
    }

    //关闭弹窗
    function closeModel(event) {
        if (event) {
            event.stopPropagation();
        }
        _model.find('.action-view').removeClass('showView');
        setTimeout(function () {
            _model.removeClass('showModel');
        }, 500)
    }

    /*$(document).ready(function(){

        $(window).scroll(function(event){
            var winPos = $(window).scrollTop();
            if(winPos>0){
                $(".header").addClass('headerFixed');
            }else {
                $(".header").removeClass('headerFixed');
            }
        });

    })*/
    function copyLink() {
        var text = ajaxUrl + '/api/share/news?type=5&id='+member_id;
        copy(text);
    }


    //scene:session（会话）timeline（朋友圈）favorite（收藏）
    //title:标题
    //thumb 图标
    //contentUrl 分享的地址

    //微信好友分享
    function shareWx(){
        var p = {
            apiKey: '',
            scene: 'session',
            title: shareTitle,
            thumb: 'widget://icon/logo.png',
            description:shareInfo,
            contentUrl:ajaxUrl + '/api/share/news?type=5&id='+member_id,
        };
        wxpyqFX(p);
    }
    //朋友圈
    function shareWxq(){
        var p = {
            apiKey: '',
            scene: 'timeline',
            title: shareTitle,
            thumb: 'widget://icon/logo22.png',
            description:shareInfo,
            contentUrl:ajaxUrl + '/api/share/news?type=5&id='+member_id,
        };
        wxpyqFX(p);
    }
    //qq好友
    function shareQq(){
        var p = {
            url: ajaxUrl + '/api/share/news?type=5&id='+member_id,
            title: shareTitle,
            description: shareInfo,
            imgUrl: shareImg,
            type:'QFriend'
        }
        qqfx(p);
    }

    //qq空间
    function shareQzone(){
        var p = {
            url: ajaxUrl + '/api/share/news?type=5&id='+member_id,
            title: shareTitle,
            description: shareInfo,
            imgUrl: shareImg,
            type:'QZone'
        }
        qqfx(p);
    }

    //微博
    function shareWb(){
        var p = {
            apiKey: '',
            scene: 'session',
            title: shareTitle,
            description: shareInfo,
            thumb: 'widget://icon/logo22.png',
            contentUrl:ajaxUrl + '/api/share/news?type=5&id='+member_id,
        };
        weibo_authorize(p);
    }

    function choose(type, event) {
        event.stopPropagation();
        if (type == 1) {
            console.log('choose:' + type)
        } else {
            console.log('choose:' + type)
        }
    }


    $(function () {
        var swiper = new Swiper('.main-banner', {
            autoplay: 4000,
            pagination: '.main-banner .swiper-pagination',
            loop: true,
            autoplayDisableOnInteraction: false,
        })
    })

</script>
